<?php


namespace app\common\controller;
use app\common\model\Classes as ClassesModel;
use think\Controller;
use think\db\exception\DataNotFoundException;

class Classes extends Controller
{
    //    操作类别
    public function selectAllClasses(){
        $classes = new ClassesModel();
        try {
            return  $data = $classes->all();
        } catch (DataNotFoundException $e) {
        }
    }

    //    根据分类号查询~
    public function selectClassFromId($classId){
        $classes = new ClassesModel();
        try {
            return  $data = $classes->where("class_id", $classId)->find();
        } catch (DataNotFoundException $e) {
        }
    }
}